package com.bml.architect.proivder;

import com.bml.architect.framework.Address;
import com.bml.architect.framework.ProtocolFactory;
import com.bml.architect.framework.protocol.Protocol;
import com.bml.architect.framework.register.AddressRegister;
import com.bml.architect.framework.register.LocalRegister;
import com.bml.architect.framework.register.ZookeeperRegister;
import com.bml.architect.proivder.api.UserService;
import com.bml.architect.proivder.iml.UserServiceImpl;

public class ProviderApplication {

    public static void main(String[] args) {

        LocalRegister.register(UserService.class.getName(), UserServiceImpl.class);

        Address address = new Address("localhost",8083);
        //AddressRegister.registerAddress(UserService.class.getName(),address);
        ZookeeperRegister.register(UserService.class.getName(),address);
        Protocol protocol = ProtocolFactory.getProtocol();
        protocol.start(address);
    }
}
